#! /bin/bash
echo our first parameters passed were 100 and 100
RES1=`java -jar Grades.jar 100 100`

PASS=0
FAIL=0

EXPRES1="Pass with distinction"
EXPRES2="Fail"
EXPRES3="Pass"
EXPRES4="Component Fail"

if [ "$RES1" = "$EXPRES1" ]
then 
	echo Result found
	PASS=$((PASS+1))
else
	echo Expected result not found
	FAIL=$((FAIL+1))
fi

echo our second parameters passed were 40 and 40
RES2=`java -jar Grades.jar 40 40`

if [ "$RES2" = "$EXPRES2" ]
then 
	echo Result found
	PASS=$((PASS+1))
else
	echo Expected result not found
	FAIL=$((FAIL+1))
fi

echo our third parameters passed were 10 and 4
RES3=`java -jar Grades.jar 10 4`

if [ "$RES3" = "$EXPRES4" ]
then 
	echo Result found
	PASS=$((PASS+1))
else
	echo Expected result not found
	FAIL=$((FAIL+1))
fi

echo our second parameters passed were 90 and 99
RES4=`java -jar Grades.jar 90 99`

if [ "$RES4" = "$EXPRES1" ]
then 
	echo Result found
	PASS=$((PASS+1))
else
	echo Expected result not found
	FAIL=$((FAIL+1))
fi

echo our second parameters passed were 50 and 75
RES5=`java -jar Grades.jar 50 75`

if [ "$RES5" = "$EXPRES3" ]
then 
	echo Result found
	PASS=$((PASS+1))
else
	echo Expected result not found
	FAIL=$((FAIL+1))
fi

echo passed $PASS
echo Fail $FAIL 





